<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <title>hello world</title>
</head>
<body>
<div id="app">
    <h1>hello world</h1>
    用户名: <input type="text" v-model="username">
    <button @click="submit">提交</button>
</div>
</body>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
    axios.defaults.baseURL = 'http://localhost:8080'
    axios.defaults.withCredentials=true;
    new Vue({
        el: "#app",
        data() {
            return {
                username: ''
            }
        },
        methods: {
            submit() {
                axios.post('login', {
                    username: this.username
                }).then(function (response) {
                    console.log(response);
                }).catch(function (error) {
                    console.log(error);
                });
            }
        }
    })
</script>
</html>